<?php
namespace App\Module\Admin\Request\Teacher;

use Hyperf\Validation\Request\FormRequest;
use Hyperf\Validation\Rule;

class UpdateRequest extends FormRequest{

    public function authorize(): bool
    {
        return true;
    }

    public function rules(): array
    {
        return [
            'name'=>'required',
            'mobile'=>['required','digits:11',Rule::unique("teacher")->ignore($this->route("id"),"teacher_id")],
            'photo'=>'required|url',
            'wechat_no'=>'required',
            'introduct'=>'required',
            'sex'=>'required|in:男,女',
            'campus'=>'required',
        ];
    }
}